package com.zhiyou.hospital.ssh.dao.impl;

import com.zhiyou.hospital.ssh.dao.IRoleDao;
import com.zhiyou.hospital.ssh.model.RoleModel;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by zhouyanchao on 2017/10/19.
 * Descr:
 */
@Repository
public class RoleDaoImpl extends BaseDaoImpl<RoleModel> implements IRoleDao {
	@Override
	public List<RoleModel> queryAllRoles() {

		Session session = factory.getCurrentSession();
		List<RoleModel> roles = session.createQuery("from RoleModel").list();

		return roles;
	}
}
